package com.sskj.spk.presenter;


import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.spk.bean.ChartViewCj;
import com.sskj.spk.http.HttpConfig;
import com.sskj.spk.ui.fragment.TradeFragment;
import com.sskj.lib.http.JsonCallBack;

/**
 * @author Hey
 * created at 2018/4/4 13:34
 */
public class TradePresenter extends BasePresenter<TradeFragment> {

    /**
     * 获取成交数据
     *
     * @author Hey
     * created at 2018/4/4 13:23
     */
    public void getTradeList(String code, int page) {

        httpService.getLevelVolumeList(code, page)
                .execute(new JsonCallBack<HttpData<ChartViewCj>>(false) {
                    @Override
                    public void onSuccess(Response<HttpData<ChartViewCj>> response) {
                        HttpData<ChartViewCj> bean = response.body();
                        if (bean.getStatus() == HttpConfig.OK) {
                            if (bean.getData() != null) {
                                mView.setData(bean.getData());
                            }
                        }
                    }
                });
    }

}
